package git.determinal.template;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
import org.springframework.cloud.client.loadbalancer.LoadBalanced;
import org.springframework.cloud.netflix.eureka.EnableEurekaClient;
import org.springframework.context.annotation.Bean;
import org.springframework.web.client.RestTemplate;

@SpringBootApplication
@EnableEurekaClient
//2.用于标识该项目是一个Eureka客户端(发现服务)
@EnableDiscoveryClient
public class InstanceClient1Application {

    public static void main(String[] args) {
        SpringApplication.run(InstanceClient1Application.class, args);
    }

    //2.创建RestTemplate实例对象，用来远程调用服务
    @Bean
    @LoadBalanced
    public RestTemplate restTemplate(){
        return new RestTemplate();
    }
}

